exports.build_models=[
	{
		name: "user",
		admin_code: true,
		column_patches: {
			date_cr: { skip_edit: true, skip_admin_list: true },
			regsid: { skip_edit: true, skip_admin_list: true },
			last_name: {skip_admin_list: true},
			first_name: {skip_admin_list: true},
			second_name: {skip_admin_list: true},
			calc_full_name: { list_width: 200, skip_edit: true},
			password: { skip_admin_list: true},
			email: { list_width: 170},
			no_roles: { datatype: "checkbox", skip_edit: true, skip_admin_list: true},
			sex_id: { list_width: 60, fk_select: "select id,name from Tsexes order by id", add_null: true},
			date_last_page: {skip_edit: true}
		},
		edit_footer: [
			{
				type: "checkboxlist",
				name: "uenrolled",
				model: {
					name:"user_enrolled",
					available_name: "role",
					available_href: {order_by: "main.name"},
					fk: "role_id",
					limit: "user_id"
				}
/*				available: "select id,name from Troles order by name",
				selected: "select role_id as id from Tusers_enrolled where user_id=:id",
				insert: "insert into Tusers_enrolled (user_id,role_id"*/
			}
		]
	},
	{
		name: "user_enrolled",
		table: "Tusers_enrolled",
		column_patches: { user_id: {nofk:1}, role_id: {nofk:1}}
	},
	{
		name: "admin_nav",
		table: "Tadmin_nav",
		admin_code: true,
		column_patches: {
			parent_id: { fk_select: "select id,name from Tadmin_nav where coalesce(parent_id,0)=coalesce(:parent_id,0) order by name", list_width: 200,add_null:true, fk_hier: true},
			role_id: { fk_select: "select id,name from Troles order by id", list_width: 150},
			href: { list_width: 170},
			name: { list_width: 200}
		},
		hier: true
	},
	{name: "role", admin_code: true},
	{
		name: "news",
		table: "Tnews",
		admin_code: true,
		column_patches: {
			date_cr: { skip_edit: true, skip_admin_list: true },
			feed_id: {
				list_width: 200,
				fk_select: "select id,name from Tnews_feeds order by id"
			},
			calc_code: {
				skip_edit: true,
				skip_admin_list: true
			},
			name: { list_width: 250},
			"abstract": { skip_admin_list: true, wysiwyg: true},
			"body": { skip_admin_list: true, wysiwyg: true},
			"enabled": {def_value: 1}
		},
		admin_list_ordering: "main.date_use desc"
	},
	{
		name: "page"/*,
		multilanguage_columns: ["name","title","subject","description","keywords"]*/
	},
	{
		name: "page_block"/*,
		multilanguage_columns: ["body"]*/
	},
	{name: "market_vendor", admin_code: true},
	{name: "market_category", table: "Tmarket_categories", admin_code: true},
	{name: "market_category_param_datatype", admin_code: true},
	{name: "market_category_param_group", admin_code: true},
	{name: "market_category_param", admin_code: true},
	{name: "market_item", admin_code: true},
	{name: "market_item_param_value", admin_code: true},
	{name: "market_cart_state", admin_code: true},
	{name: "market_cart"},
	{name: "market_cart_item"},
	{
		name: "news_feed",
		admin_code: true,
		column_patches: {
			code: { list_width: 150},
			name: { list_width: 250}
		}
	},
	{
		name: "slider_image_group",
		admin_code: true,
		column_patches: {
			code: { list_width: 150},
			name: { list_width: 250}
		}
	},
	{
		name: "slider_image",
		admin_code: true,
		column_patches: {
			group_id: {
				fk_select: "select id,name from Tslider_image_groups order by name",
//				skip_admin_list: true,
				add_null: true
			}
		},
		admin_list_ordering: "main.group_id,main.ordering"
	},
	{
		name: "infoblock_group",
		admin_code: true,
		column_patches: {
			code: { list_width: 150},
			name: { list_width: 250}
		}
	},
	{
		name: "infoblock",
		admin_code: true,
		column_patches: {
			group_id: {
				fk_select: "select id,name from Tinfoblock_groups order by name",
				skip_admin_list: true,
				add_null: true
			},
			url: { list_width: 200 },
			header: { list_width: 250 },
			body: { wysiwyg: true, skip_admin_list: true}
		},
		admin_list_ordering: "main.group_id,main.ordering"
	},
	{
		name: "custom_nav",
		admin_code: true,
		admin_list_columns: [
			{name: "name", list_width: 200},
			{name: "link", datatype: "html",html: "<a href=\"/admin-auto_custom_nav_item/?nav_id={{row.id}}\">{{!link_edit}}</a>", list_width: 200}
		]
	},
	{
		name: "custom_nav_item",
		admin_code: true,
		admin_list_ordering: "main.parent_id,main.ordering",
		column_patches: {
			name: { list_width: 200},
			nav_id: {
				skip_admin_list: true,
				skip_edit: true,
				through: true,
				admin_list_filter: true
			},
			parent_id: {
				fk_select: "select id,name from Tcustom_nav_items where nav_id=:nav_id order by name",
				skip_admin_list: true,
				add_null: true
			},
			image_id: {},
			href: { list_width: 200 },
			page_id: {fk_select: "select id,alias as name from Tpages order by name", list_width: 200, add_null: true},
			description: { skip_admin_list: true, wysiwyg: true }
		},
		hier: true
	},
	{
		name: "form_style"
	},
	{
		name: "form"
	},
	{
		name: "file_group"
	},
	{
		name: "guestbook",
		admin_code: true,
		column_patches: {
			premoderation: { datatype: "checkbox"},
			users_can_post: { datatype: "checkbox"},
			email_template: { skip_admin_list: true }
		}
	},
	{
		name: "guestbook_message",
		column_patches: {
			date_question: { skip_edit: true, skip_admin_list: true, skip_insert: true, skip_update: true },
			user_a_id: { avatar: 1}
		}
	},
	{
		name: "embeded_text",
		admin_code: true,
		column_patches: {
		}
	},
	{
		name: "forum_category",
		table: "Tforum_categories",
		admin_code: true,
		hier:1,
		column_patches: {
			name: {list_width: 300},
			parent_id: { fk_select: "select id,name from Tforum_categories where coalesce(parent_id,0)=coalesce(:parent_id,0) order by name", list_width: 200,add_null:true, fk_hier: true},
			anon_can_read: { datatype: "checkbox" },
			role_read_id: { fk_select: "select id,name from Troles order by name", list_width: 150,add_null:true},
			role_write_id: { fk_select: "select id,name from Troles order by name", list_width: 150,add_null:true},
			role_moder_id: { fk_select: "select id,name from Troles order by name", list_width: 150,add_null:true}
		},
		admin_list_ordering: "main.ordering"
	},
	{
		name: "forum_message",
		column_patches: {
			user_cr_id: { avatar: 1}
		}
	},
	{
		name: "mail_template",
		admin_code: true,
		admin_role: "templates",
		column_patches: {
			code: { list_width: 250},
			name: { list_width: 350},
			default_from: { skip_admin_list: true},
			default_to: { skip_admin_list: true},
			subject: { skip_admin_list: true},
			body: { skip_admin_list: true}
		}
	},
	{
		name: "gdbe_style",
		admin_code: true,
		admin_role: "templates",
		admin_list_ordering: "main.ordering",
		column_patches: {
			name: { list_width: 300 }
		},
		admin_list_columns: [
			{name: "ordering"},
			{name: "name", list_width: 200},
			{name: "link", datatype: "html",html: "<a href=\"/admin-auto_gdbe_style_block/?style_id={{row.id}}\">{{!!link_edit}}</a>", list_width: 200}
		]
	},
	{
		name: "gdbe_style_block",
		admin_code: true,
		admin_role: "templates",
		admin_list_ordering: "main.ordering",
		column_patches: {
			style_id: {
				skip_admin_list: true,
				skip_edit: true,
				through: true,
				admin_list_filter: true
			},
			name: { list_width: 250 },
			fields: { list_width: 200 },
			edit_html: { skip_admin_list: true},
			preview_html: { skip_admin_list: true},
			result_html: { skip_admin_list: true}
		}
	},
	{
		name: "gdbe_source_group"
	},
	{
		name: "gdbe_source"
	}
];
